//
//  CityMenuTableDataViewCell.m
//  AroundTheWorld
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 IfelseGo an. All rights reserved.
//

#import "CityMenuTableDataViewCell.h"
#define WIDTH self.frame.size.width
#define HEIGHT self.frame.size.height

@implementation CityMenuTableDataViewCell

//自定义初始化
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addView];
    }
    return self;
}

- (void)addView
{
    self.nameLabel = [self addUILabel];
    self.fgxLabel = [self addUILabel];
    //点击cell字体颜色
    self.nameLabel.highlightedTextColor = [UIColor colorWithRed:75 / 255.0 green:197 / 255.0 blue:143 / 255.0 alpha:1.0];
    
    //点击cell背景颜色
    self.selectedBackgroundView = [[UIView alloc] initWithFrame:self.frame];
    self.selectedBackgroundView.backgroundColor = [UIColor colorWithRed:247 / 255.0 green:245 / 255.0 blue:248 / 255.0 alpha:1.0];
    self.fgxLabel.backgroundColor = [UIColor colorWithRed:235 / 255.0 green:232 / 255.0 blue:232 / 255.0 alpha:1.0];
    
//    UILabel *tt = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 3, 60)];
//    tt.backgroundColor = [UIColor colorWithRed:75 / 255.0 green:197 / 255.0 blue:143 / 255.0 alpha:1.0];
//    [self.selectedBackgroundView addSubview:tt];
}

- (UILabel *)addUILabel
{
    UILabel *label = [[UILabel alloc] init];
//    label.backgroundColor = [UIColor whiteColor];
//    label.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:label];
    return label;
}

//分布
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.nameLabel.frame = CGRectMake(20, 0, WIDTH - 40, HEIGHT);
    self.fgxLabel.frame = CGRectMake(20, HEIGHT - 1, WIDTH - 40, 1);
}

- (void)setMyModel:(FindTravellingMenuDestinationPlaceModel *)myModel
{
    _myModel = myModel;
    self.nameLabel.text = _myModel.place_name;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
